/*
 * Copyright (c) 2006 - 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * <p>Project: app2022 - Ex
 * <p>Powered by webrx On 2022-02-08 10:28:43
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Ex {
    public static void main(String[] args) {
        //ExecutorService es = Executors.newSingleThreadExecutor();

        var es = new ThreadPoolExecutor(5, 5, 0L, TimeUnit.SECONDS, new LinkedBlockingQueue<>());
        for (int i = 0; i < 500; i++) {
            es.execute(() -> {
                System.out.println(Thread.currentThread().getName());
            });
        }
        es.shutdown();


    }
}
